<?php

/* 

 * To change this license header, choose License Headers in Project Properties.

 * To change this template file, choose Tools | Templates

 * and open the template in the editor.

Array

(

    [username] => 

    [sex] => 鐢�

    [message] => 

    [imgurl] => images/1.jpg

) CRUD  Create 添加；Retrive获取，Update更新， Delete删除

 *  insert into

 *  select 

 *  update 

 *  delete

 * 

 * 

 */
header("content-type:text/html;charset=utf-8");
$username = $_POST['username'];
$sex = $_POST['sex'];
$message = $_POST['message'];
$imgurl = $_POST['imgurl'];
$time_at = time();


require_once 'db_conn.php';
$sql = "
INSERT INTO `bbs`.`t_message` (`id`, `username`, `sex`, `content`, `avater`, `time_at`) VALUES (NULL,'$username',  '$sex',  '$message',  '$imgurl',  '$time_at');


";
//echo $sql;

//die;



$result = $conn->query($sql);
if($result === false ){
    echo "数据库操作失败！！！:(";
}else {
    header("Location: index_2.php");
}

